<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="public:meta" />
	<link href="../public/css/personal/common.css" rel="stylesheet" type="text/css" />
	<link href="../public/css/personal/personal_index.css" rel="stylesheet" type="text/css" />
	<link href="../public/css/personal/personal_ajax_dialog.css" rel="stylesheet" type="text/css" />
	<script src="../public/js/personal/jquery.common.js" type="text/javascript" language="javascript"></script>
	<script src="../public/js/jquery.cookie.js" type="text/javascript" language="javascript"></script>
</head>
<body>
	<include file="index_header" />
	<div class="user_main">
		<include file="index_left_nav" />
		<div class="mainbox">
			<div class="userbox ">
				<div class="td1 substring"><strong><if condition="date('a') eq 'am'">上午<else/>下午</if>好，{$visitor['username']}</strong></div>
				<div class="td2 <if condition="$visitor['mobile_audit']">ok link_blue<else/>link_gray6</if>"><a href="{:U('personal/user_safety')}">{$visitor['mobile']}</a></div>
				<div class="td3 <if condition="$visitor['email_audit']">ok link_blue<else/>link_gray6</if>"><a href="{:U('personal/user_safety')}">{$visitor['email']}</a></div>
				
				<div class="clear"></div>
			</div>
			<!-- 我的简历和统计部分-- -->
		 	<div class="infobox">
				<div class="picbox">
					<div class="photo"><a href="{:U('personal/user_avatar')}"><img src="{$visitor['avatars']}?{:time()}" border="0"/></a></div>
			    	<div class="txt link_blue">我的头像</div>
				</div>
				<div class="clear"></div>
				<!-- 
				<div class="td2 J_hoverbut" onclick="window.location='{:U('personal/resume_privacy')}'"><div class="pic <if condition="$resume_info['display'] eq 0">close</if>"></div> <if condition="$resume_info['display']">简历公开<else/>简历关闭</if></div>
				 -->
				<div class="td3 " ><div class="val">{$resume_info['countapply']|default=0}</div> 已申请职位</div>
				<div class="td4 " ><div class="val">{$resume_info['countinterview']|default=0}</div> 面试邀请</div>
				
				<div class="td5 " ><div class="val">{$resume_info['offer']|default=0}</div> Offer</div>
				 
				<div class="clear"></div>
			</div>
			
			<!-- 我的简历和统计部分结束-- -->
			<!-- 刷新推广修改-- -->
			<div class="resumeinfo">
			  <div class="linfo">	
			    <div class="td2">
			      期望职位：{:cut_str($resume_info['intention_jobs'],12,0,'..')}
			      </div>
			    <div class="td2">期望薪资：{$resume_info['wage_cn']}</div>
			    
			    <div class="clear"></div>
		      </div>
		      <div class="linfo">
		      	<div class="td2">求职状态：{$resume_info['current_cn']}</div>
			    <div class="td2">更新时间：{:fdate($resume_info['refreshtime'])}</div>
		      </div>
			  
			   <div class="clear"></div>
		  </div>
		  <if condition="$resume_list">
		  		<volist name="resume_list" id="resume">
		  <div class="resumeinfo">
		  		<div class="resume_item">
		  			<div class="cleft">
		  				<span class="name substring link_gray6"><a target="_blank" href="{:url_rewrite('QS_resumeshow',array('id'=>$resume['id'],'preview'=>1))}" <if condition="$resume['display'] eq 0">class="close"</if> title="{$resume.title}">{$resume.title}</a></span>
		  				<div class="state">
		  					<div class="title">完整度：</div>
							<div class="progress"><div style="width:{$resume.complete_percent}%;"></div></div>
							<div class="percent">{$resume.complete_percent}%&nbsp(<if condition="$resume['complete_percent'] egt 80"><span class="t1">优</span><elseif condition="$resume['complete_percent'] lt 60"/><span class="t1">差</span><else/><span class="t1">良</span></if>)</div>
		  				</div>
		  				
		  			</div>
		  			<div class="cright">
		  				<a href="{:U('personal/resume_edit',array('pid'=>$resume['id']))}">修改</a>
		  				<a target="_blank" href="{:url_rewrite('QS_resumeshow',array('id'=>$resume['id'],'preview'=>1))}">预览</a>
		  			</div>
				</div>
		  </div>
		  </volist>
		  	<else />
		  		<div class="res_empty">
					简历是求职的利器，填写简历才能更快找到好工作！<br />
					去填写一份优质的简历吧，认真的人，才能让认真的企业找上你！
				</div>
			    <div class="res_empty_addbox">
					<div class="but_blue_115 J_hoverbut" onclick="window.location='{:U('personal/resume_add')}'">创建简历</div>
				</div>
		  	</if>
 
			 
		<div class="clear"></div>
	</div>
	</div>
	<include file="index_footer" />
	<script type="text/javascript">
		$(".bind_wx").click(function(){
			$('#J_popWeixin').show();
		});
		// 关闭微信绑定提示
        $('#J_popWeixin .close').on('click', function(){
            $('#J_popWeixin').hide();
        });
        // 推荐职位、附近职位、最新职位切换加载内容
        var isDone = true; // 防止重复点击
        $('.J_tab').on('click', function(event) {
        	$(this).addClass("select").siblings(".J_tab").removeClass("select");
        	var obj = $('.J_tab.select');
        	var index = $(".J_tab").index(this);
        	var ajaxtype = $(this).data('ajaxtype');
        	var ajaxpage = parseInt(obj.attr('ajaxpage')); // 记录页数
        	$('.J_tab_menu').eq(index).find('.ajax_loading').show();
        	$.getJSON("{:U('Personal/ajax_get_interest_jobs')}", {type: ajaxtype}, function(data) {
        		$('.J_tab_menu').find('.ajax_loading').hide();
        		if (data.data.html) {
        			$('.J_tab_menu').eq(index).find('.J_tab_menu_html').html(data.data.html);
        			if(data.data.isfull){
                        obj.attr('ajaxpage', 1);
                    }else{
                        obj.attr('ajaxpage', ajaxpage+1);
                    }
        		} else {
        			$('.J_tab_menu').eq(index).find('.J_tab_menu_html').html('<div class="empty_tipstxt link_blue">没有找到相关职位，您可以<a href="{:U('jobs/index')}" target="_blank">进入职位库</a>试试手气！</div>');
        		}
        	});
        	$('.J_tab_menu').eq(index).show().siblings(".J_tab_menu").hide();
        	isDone = true; // 切换tab之后重置
        });
        // 换一批
        $('.J_refresh').on('click', function(event) {
        	var obj = $('.J_tab.select');
        	var ajaxtype = obj.data('ajaxtype');
        	var ajaxpage = parseInt(obj.attr('ajaxpage')); // 记录页数
        	var sub = 0; // 获取选中tab的下标
        	$('.J_tab').each(function(index, el) {
        		if ($(this).hasClass('select')) {
        			sub = index;
        		}
        	});
        	$('.J_tab_menu').eq(sub).find('.ajax_loading').show();
        	if (isDone) {
        		isDone = false;
	        	$.getJSON("{:U('Personal/ajax_get_interest_jobs')}", {type: ajaxtype, p: ajaxpage}, function(data) {
	        		$('.J_tab_menu').eq(sub).find('.J_tab_menu_html').html(data.data.html);
	        		obj.attr('ajaxpage', ajaxpage+1);
	        		isDone = true;
	        		$('.J_tab_menu').find('.ajax_loading').hide();
	        		if(data.data.isfull){
                        obj.attr('ajaxpage', 1);
                    }else{
                        obj.attr('ajaxpage', ajaxpage+1);
                    }
	        	});
        	};
        });
        $('#J_refresh_resume').click(function() {
        	var pid = $(this).attr('pid');
			var _audit = $(this).attr('_audit');
			var is_display = eval($(this).attr('is_display'));
			if (_audit != 1){
				disapperTooltip('remind',"审核中或未通过的简历无法刷新！");
			} else if(!is_display){
				disapperTooltip('remind',"默认简历已关闭，无法刷新！");
			} else {
				$.post("{:U('Personal/refresh_resume')}",{pid:pid},function(result){
					if(result.status == 1){
						disapperTooltip('success',result.msg);
						setTimeout(function () {
							window.location.reload();
						}, 2000);
					}else{
						disapperTooltip('remind',result.msg);
					}
				},'json');
			}
        });
        // 签到
        $('#J_sign_in').click(function(){
        	var f = $(this);
        	$.getJSON("{:U('Members/sign_in')}",function(result){
        		if(result.status == 1){
        			disapperTooltip("goldremind", '每天签到增加'+result.data+'{:C("qscms_points_byname")}<span class="point">+'+result.data+'</span>');
        			f.addClass('btn_lightgray').text('已签到');
	    			$(".my_points_num").html(parseInt($(".my_points_num").html())+parseInt(result.data));
        		}else{
        			disapperTooltip('remind',result.msg);
        		}
        	});
        });
        $(".resume_stick").click(function(){
			var _audit = $(this).attr('_audit');
			var is_display = eval($(this).attr('is_display'));
			if (_audit != 1){
				disapperTooltip('remind',"审核中或未通过的简历无法置顶！");
			} else if(!is_display){
				disapperTooltip('remind',"默认简历已关闭，无法置顶！");
			} else {
				var qsDialog = $(this).dialog({
					title: '简历置顶',
					loading:true,
					showFooter: false
				});
				var url = "{:U('PersonalService/resume_stick')}";
				var resume_id = $(this).attr('resume_id');
				$.getJSON(url,{resume_id:resume_id},function(result){
					qsDialog.setContent(result.msg);
				});
			}
        });
        
        <if condition="$wx_status eq '' and $qrcode neq ''">
			function waiting_weixin_bind(){
				$.getJSON("{:U('Members/waiting_weixin_bind')}",function(result){
					if(result.status == 1){
						location.reload();
					}
				});
			}
			var qrcode_time = setInterval(waiting_weixin_bind,5000);
		</if>
		$("#ignore").click(function(){
			$.cookie("{$resume_info['uid']}_hidden_perfect_notice",1);
			$(".toptip").hide();
			$(".userbox").removeClass('showtip');
		});
    </script>
</body>
</html>